<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Prezentari</title>

<link type="text/css" rel="stylesheet" href="css/prez.css?v=8">

<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">	
		function deletePresentation(i) {
			var _id = $("#idSpan"+i).text();
			var title = $("#titleSpan"+i).text();
			if(confirm("Sigur sterg \""+title+"\" ?")) {				
				window.location.href = "/presentationsList.htm?action=remove&_id="+_id;
			}
		}			
</script>

</head>
<body class="presentationsListBody">
	<a class="presentationsListNewLink" href="/presentation.htm">Creaza prezentare noua</a>
	<br>
	<br>
	<br>
	<br>
	<% for(int i=0; i<Integer.parseInt(request.getAttribute("presentationsCount").toString()); i++) { %>
		<span id="idSpan<%=i%>" style="display: none;"><%=request.getAttribute("_id"+i)%></span>
		<a href='/presentation.htm?_id=<%=request.getAttribute("_id"+i)%>' class="presentationsListExistingTitleLink" style="vertical-align: text-top;">
			<span id="titleSpan<%=i%>"><%=request.getAttribute("title"+i) %></span>
			<br>
			<img class="presentationsListExistingThumb" src='/img?_id=<%=request.getAttribute("_id"+i)%>&slideIndex=0'></a> 
		<br>
		<span class="presentationsListCreationDate">
		Creata pe data de <%=request.getAttribute("creationDate"+i) %>
		<br>
		</span>
		<input type="button" 
			onclick='deletePresentation(<%=i%>)'
			class="presentationsListDeleteButton"
			value="Sterge">	
		<br>	
		<br>
		<br>
		<br>
	<% } %>
</body>
</html>